//输出今天的日期和周几，周几用汉字表示

import java.time.LocalDate
import java.time.format.DateTimeFormatter
import java.time.DayOfWeek

object CurrentDateAndWeekday {
  def main(args: Array[String]): Unit = {
    // 获取当前日期
    val today = LocalDate.now()

    // 定义日期格式化器，用于输出日期
    val dateFormatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日")
    val formattedDate = today.format(dateFormatter)

    // 获取今天是星期几
    val dayOfWeek = today.getDayOfWeek()
    val chineseWeekday = dayOfWeek match {
      case DayOfWeek.MONDAY => "星期一"
      case DayOfWeek.TUESDAY => "星期二"
      case DayOfWeek.WEDNESDAY => "星期三"
      case DayOfWeek.THURSDAY => "星期四"
      case DayOfWeek.FRIDAY => "星期五"
      case DayOfWeek.SATURDAY => "星期六"
      case DayOfWeek.SUNDAY => "星期日"
    }

    // 输出结果
    println(s"今天是 $formattedDate，$chineseWeekday")
  }
}